#include "ddt.h"
#include <stdio.h>
#include <unistd.h>
#include <stdio.h>

void update();
void draw();

float tri2[] = {
		0.0f, 0.0f, 1.0f,
		-5.0f, -5.0f, 1.0f,
		5.0f, -5.0f, 1.0f,

		0.0f, 0.0f, 1.0f,
		5.0f, 5.0f, 1.0f,
		-5.0f, 5.0f, 1.0f
	};

int main() {

	dd_screensize(50, 50);
	dd_pixelsize(0);
	printf("screen: %d x %d\n", dd_swidth, dd_sheight);

	dd_draw_func(draw);
	dd_loop();

	return 0;
}

void update() {
	dd_matrix_rotate_z(dd_global_matrix, 0.1f);
}

void draw() {
	dd_buffer_clear();

	dd_vertex_draw(6, (float*) &tri2);

	dd_buffer_draw();

	usleep(25000);
}
